package com.hfh.file.exer;

import org.junit.Test;

import java.io.File;

public class Exer {
    @Test
    public void test2(){
        File file = new File("file\\jpg");
        File[] arr = file.listFiles();
        for (File f: arr){
            if(f.getName().contains("jpg")){
                System.out.println(f.getName());
            }
        }

       /* String[] arr = file.list();
        for (String list: arr){
            if (list.substring(list.length() - 3).equals("jpg")){
                System.out.println(list);
            }
        }*/
    }

    @Test
    public void test1(){
        File file = new File("file\\jpg");
        String[] arr = file.list();
        for (String list: arr){
            System.out.println(list);
        }
    }

    @Test
    public void test(){
        File file = new File("file\\mp4");
        file.mkdirs();
    }

}
